package com.yiban.demo.Station.Service;

import com.yiban.demo.Order.OrderEvent.DeliveryOrderEvent;
import com.yiban.demo.Order.OrderEvent.EndOrderEvent;
import com.yiban.demo.Order.OrderEvent.NewOrderEvent;
import com.yiban.demo.Station.Entity.NearByStation;
import com.yiban.demo.Station.Entity.Station;
import com.yiban.demo.Station.Entity.StationOrderMessage;
import com.yiban.demo.Station.Entity.StationStatus;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import java.util.Optional;

public interface StationService {
    boolean registerStation(Station station,Integer userId);
    boolean passRegisterRequest(Integer stationId);
    List<Station> getRegisterRequest(Long current,Long size);

    Map<Integer,Station> getPushStations();

    Optional<List<NearByStation>> getNearStation(BigDecimal longitudes, BigDecimal latitudes);

    boolean isOnline(Integer stationId);
    Optional<Station> getStation(Integer stationId);

    StationStatus sentMessage(Integer stationId, StationOrderMessage msg);

    List<Station> getOnlineStations();


    void deliveryEventListen(DeliveryOrderEvent deliveryOrderEvent);

    void newOrderEventListen(NewOrderEvent newOrderEvent);

    void endOrderEventListen(EndOrderEvent endOrderEvent);
}
